package vn.edu.uit.chemistry.view;

import vn.edu.uit.chemistry.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

public class ViewGuiTaiLieu extends AbstractView{
	
	TextView tvTenHS;
	TextView tvMSHS;
	ProgressBar prWait;
	ImageView imgFinish;

	public ViewGuiTaiLieu(Context context) {
		super(context);
		
		pContext = context;
		mInflater = LayoutInflater.from(pContext);
		layout = mInflater.inflate(R.layout.row_gui_tai_lieu, null);
		
		tvTenHS = (TextView) layout.findViewById(R.id.tvHoTen);
		tvMSHS = (TextView) layout.findViewById(R.id.tvMSHS);
		prWait = (ProgressBar) layout.findViewById(R.id.prPercent);
		imgFinish = (ImageView) layout.findViewById(R.id.imgDiemDanh);
	}
	
	public void setContent(String _tenHS, String _mshs, int _isFinish) {
		tvTenHS.setText("Họ tên: "+_tenHS);
		tvMSHS.setText("MSHS: "+_mshs);
		if (_isFinish == 1) {
			prWait.setVisibility(View.GONE);
			imgFinish.setVisibility(View.VISIBLE);
		} else if (_isFinish == 0) {
			prWait.setVisibility(View.VISIBLE);
			imgFinish.setVisibility(View.GONE);
		} 
	}
	
}
